package main

import (
	"ServiceComputing/hw6-rxgo/rxgo"
	"fmt"
)

func main() {
	fmt.Println("Distinct:")
	rxgo.Just(1, 12, 123, 1234, 12345, 1234).Distinct().Subscribe(func(x int) {
		fmt.Print(x)
		fmt.Print(" ")
	})
	fmt.Println()

	fmt.Println("ElementAt:")
	rxgo.Just(1, 12, 123, 1234, 12345).ElementAt(3).Subscribe(func(x int) {
		fmt.Print(x)
	})
	fmt.Println()

	fmt.Println("First:")
	rxgo.Just(1, 12, 123, 1234, 12345).First().Subscribe(func(x int) {
		fmt.Print(x)
		fmt.Print(" ")
	})
	fmt.Println()

	fmt.Println("Take:")
	rxgo.Just(1, 12, 123, 1234, 12345).Take(4).Subscribe(func(x int) {
		fmt.Print(x)
		fmt.Print(" ")
	})
	fmt.Println()

	fmt.Println("IgnoreElements:")
	rxgo.Just(1, 12, 123, 1234, 12345).IgnoreElements().Subscribe(func(x int) {
		fmt.Print(x)
	})
	fmt.Println()

	fmt.Println("Last:")
	rxgo.Just(1, 12, 123, 1234, 12345).Last().Subscribe(func(x int) {
		fmt.Print(x)
	})
	fmt.Println()

	fmt.Println("Skip:")
	rxgo.Just(1, 12, 123, 1234, 12345).Skip(2).Subscribe(func(x int) {
		fmt.Print(x)
		fmt.Print(" ")
	})
	fmt.Println()

	fmt.Println("SkipLast:")
	rxgo.Just(1, 12, 123, 1234, 12345).SkipLast(2).Subscribe(func(x int) {
		fmt.Print(x)
		fmt.Print(" ")
	})
	fmt.Println()

	fmt.Println("TakeLast:")
	rxgo.Just(1, 12, 123, 1234, 12345).TakeLast(3).Subscribe(func(x int) {
		fmt.Print(x)
		fmt.Print(" ")
	})
	fmt.Println()
}
